<?

function smarty_function_textarea( $params, $smarty ) {

	$smarty->depend( 'modifier', 'escape' );

	$id = smarty_modifier_escape( $params['text'] );
	$name = Smutty_Smarty::getFieldName( $params['name'] );
	$text = smarty_modifier_escape( $params['text'] );

	// add a label?
	if ( $label = $params['label'] ) {
		$smarty->depend( 'function', 'label' );
		smarty_function_label(array(
			'for' => $params['name'],
			text => $label
		), $smarty );
	}

	echo '<textarea name="' . $name . '" id="' . $id . '">' . $text . '</textarea>';

}

?>